#include "registrationexecutor.h"

RegistrationExecutor::RegistrationExecutor(){

}

RegistrationExecutor::RegistrationExecutor(Session* s){
    session = s;
}

void RegistrationExecutor::execute(Para* cmd)
{
    QBool flag = QBool(true);
    foreach (Para p, cmd->getArgs())
    {
        if (p.getName() == "success")
        {
            if (p.getText() == "TRUE"){
                emit proceed();
                return;
            }
            else
                flag = QBool(false);
            break;
        }
    }
    foreach (Para p, cmd->getArgs())
    {
        if (!flag){
            if (p.getName() == "reason")
            {
                emit fail(p.getText());
                break;
            }
        }
    }
}
